<?php
  $link = mysql_connect('', 'admin_xbq', 'nihao')
      or die('Could not connect: ' . mysql_error());
  //echo "Connected successfully\n";
  mysql_query('use test');
  //delete row from table staffroom
  if (isset($_GET['file_id'])) {
    //here should be more! should delete teacher and their files in db!s
    $sql = "delete from file where file.file_ID=".$_GET['file_id'];
    mysql_query($sql) or die('Query failed1: ' . mysql_error());
  }
  //in order to show department info in left table
  $sql = 'select * from user where user.user_ID='.$_GET['user_id'].';';
  $result = mysql_query($sql) or die('Query failed2: ' . mysql_error());
  $line = mysql_fetch_array($result, MYSQL_ASSOC);
?>

<table>
  <tr>
    <td class="style3">
      <h2><?php echo $line['user_name']; ?></h2>
    </td>
  </tr>
</table>

<table  width="100%">
<tr>
<td postion="top" class="style3">
<span>
  <table class="style2" width="200">
    <tr  bgcolor="#5B7C67">
      <td><font color="#F8F8F8">Author information</font></td>
    </tr>
    <tr>
      <td>
        <?php 
          echo '<br/>'.$line['user_duty'];
          echo '<br />';
          echo $line['user_name'];
          echo '<br />';
          echo 'Telephone: '.$line['phone'];
          echo '<br />';
          echo 'E-mail: <a href="mailto:'.$line['email'].'">'.$line['email'].'</a><br />';
          echo '<br />';
        ?>
      </td>
    </tr>
  </table>
</span>
</td>
